package seguranca.model;
// Generated Oct 23, 2014 7:15:00 PM by Hibernate Tools 4.3.1


import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TbOpcao generated by hbm2java
 */
@Entity
@Table(name="tb_opcao"
    ,catalog="bd_prototipo"
)
public class TbOpcao  implements java.io.Serializable {


     private Integer idtOpcao;
     private TbMenu tbMenu;
     private String usrOpcaoCad;
     private Date dtaOpcaoCad;
     private String usrOpcaoMod;
     private Date dtaOpcaoMod;
     private Integer ordOpcao;
     private String sglOpcao;
     private String urlOpcao;
     private Set<TaPrivilegio> taPrivilegios = new HashSet<TaPrivilegio>(0);

    public TbOpcao() {
    }

	
    public TbOpcao(TbMenu tbMenu, String usrOpcaoCad, Date dtaOpcaoCad, String sglOpcao, String urlOpcao) {
        this.tbMenu = tbMenu;
        this.usrOpcaoCad = usrOpcaoCad;
        this.dtaOpcaoCad = dtaOpcaoCad;
        this.sglOpcao = sglOpcao;
        this.urlOpcao = urlOpcao;
    }
    public TbOpcao(TbMenu tbMenu, String usrOpcaoCad, Date dtaOpcaoCad, String usrOpcaoMod, Date dtaOpcaoMod, Integer ordOpcao, String sglOpcao, String urlOpcao, Set<TaPrivilegio> taPrivilegios) {
       this.tbMenu = tbMenu;
       this.usrOpcaoCad = usrOpcaoCad;
       this.dtaOpcaoCad = dtaOpcaoCad;
       this.usrOpcaoMod = usrOpcaoMod;
       this.dtaOpcaoMod = dtaOpcaoMod;
       this.ordOpcao = ordOpcao;
       this.sglOpcao = sglOpcao;
       this.urlOpcao = urlOpcao;
       this.taPrivilegios = taPrivilegios;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)

    
    @Column(name="idt_opcao", unique=true, nullable=false)
    public Integer getIdtOpcao() {
        return this.idtOpcao;
    }
    
    public void setIdtOpcao(Integer idtOpcao) {
        this.idtOpcao = idtOpcao;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="cod_menu", nullable=false)
    public TbMenu getTbMenu() {
        return this.tbMenu;
    }
    
    public void setTbMenu(TbMenu tbMenu) {
        this.tbMenu = tbMenu;
    }

    
    @Column(name="usr_opcao_cad", nullable=false, length=20)
    public String getUsrOpcaoCad() {
        return this.usrOpcaoCad;
    }
    
    public void setUsrOpcaoCad(String usrOpcaoCad) {
        this.usrOpcaoCad = usrOpcaoCad;
    }

    @Temporal(TemporalType.DATE)
    @Column(name="dta_opcao_cad", nullable=false, length=10)
    public Date getDtaOpcaoCad() {
        return this.dtaOpcaoCad;
    }
    
    public void setDtaOpcaoCad(Date dtaOpcaoCad) {
        this.dtaOpcaoCad = dtaOpcaoCad;
    }

    
    @Column(name="usr_opcao_mod", length=20)
    public String getUsrOpcaoMod() {
        return this.usrOpcaoMod;
    }
    
    public void setUsrOpcaoMod(String usrOpcaoMod) {
        this.usrOpcaoMod = usrOpcaoMod;
    }

    @Temporal(TemporalType.DATE)
    @Column(name="dta_opcao_mod", length=10)
    public Date getDtaOpcaoMod() {
        return this.dtaOpcaoMod;
    }
    
    public void setDtaOpcaoMod(Date dtaOpcaoMod) {
        this.dtaOpcaoMod = dtaOpcaoMod;
    }

    
    @Column(name="ord_opcao")
    public Integer getOrdOpcao() {
        return this.ordOpcao;
    }
    
    public void setOrdOpcao(Integer ordOpcao) {
        this.ordOpcao = ordOpcao;
    }

    
    @Column(name="sgl_opcao", nullable=false, length=40)
    public String getSglOpcao() {
        return this.sglOpcao;
    }
    
    public void setSglOpcao(String sglOpcao) {
        this.sglOpcao = sglOpcao;
    }

    
    @Column(name="url_opcao", nullable=false, length=45)
    public String getUrlOpcao() {
        return this.urlOpcao;
    }
    
    public void setUrlOpcao(String urlOpcao) {
        this.urlOpcao = urlOpcao;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="tbOpcao")
    public Set<TaPrivilegio> getTaPrivilegios() {
        return this.taPrivilegios;
    }
    
    public void setTaPrivilegios(Set<TaPrivilegio> taPrivilegios) {
        this.taPrivilegios = taPrivilegios;
    }




}


